<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<style>
    body {
        padding: 50px;
    }
    
    .mydiv {
        height: 200px;
        width: 200px;
        border: 1px solid #ccc;
        margin-bottom: 20px;
        display: inline-block;
    }
    /* 45°折角的解决方案 */
    
    .case1 {
        background: #58a;
        /* 回退样式 */
        background: #58a;
        /* 回退样式 */
        background: linear-gradient(to left bottom, transparent 50%, rgba(0, 0, 0, .4) 0) no-repeat 100% 0 / 2em 2em, linear-gradient(-135deg, transparent 1.414213em, #58a 0);
    }
    /* 其他角度的解决方案 */
    /* 这个三角形现在确
实已经跟切角对上号了，但这个结果看起来更不真实了！ */
    
    .case2 {
        background: #58a;
        /* 回退样式 */
        background: linear-gradient(to left bottom, transparent 50%, rgba(0, 0, 0, .4) 0) no-repeat 100% 0 / 3em 1.73em, linear-gradient(-150deg, transparent 1.5em, #58a 0);
    }
    
    .case3 {
        position: relative;
        background: #58a;
        /* 回退样式 */
        background: linear-gradient(-150deg, transparent 1.5em, #58a 0);
        border-radius: .5em;
    }
    
    .case3::before {
        content: '';
        position: absolute;
        top: 0;
        right: 0;
        background: linear-gradient(to left bottom, transparent 50%, rgba(0, 0, 0, .2) 0, rgba(0, 0, 0, .4)) 100% 0 no-repeat;
        width: 1.73em;
        height: 3em;
        transform: translateY(-1.26em) rotate(-30deg);
        transform-origin: bottom right;
        border-bottom-left-radius: inherit;
        box-shadow: -.2em .2em .3em -.1em rgba(0, 0, 0, .15);
    }
</style>

<body>
    <div class="mydiv case1">fffffffffffffffffff</div>
    <div class="mydiv case2">fff</div>
    <div class="mydiv case3">ff</div>
</body>

</html>